
from handler.json_response import *

from flask import current_app
from pojo.Student import Student


from flask import (
    Blueprint, flash, g, redirect, render_template, request, session, url_for
)

bp = Blueprint('success', __name__, url_prefix='/su')


@bp.route("/success" ,methods=["POST", "GET"] )
def success():
    if hasattr(current_app , "successMethon") == False :
        current_app.successMethon = 1
    else:
        current_app.successMethon = int(current_app.successMethon) + 1
    print("请求次数：" + str(current_app.successMethon))
    student = Student(name='bigBoy', age=10, scores=100)
    retResponse = JsonResponse.success(data=student, code=200, msg="success")
    return "请求次数：" + str(current_app.successMethon)

